package cn.whpu.jdbctemplate;

import cn.whpu.dao.AccountDao;
import cn.whpu.domain.Account;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

public class JdbcTemplateDemo4 {
    public static void main(String[] args) {
        //获取容器
        ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");
        AccountDao accountDao =ac.getBean("accountDao",AccountDao.class);
        Account account =accountDao.findAccountById(1);
        System.out.println(account);

        account.setMoney(1000f);
        accountDao.updateAccount(account);

        accountDao.findAccountById(1);
        System.out.println(account);

    }
}
